import re

# group name (?P...)
print(re.search(re.compile(r'(?P<dota>\d+)(?P<lol>\D+)'), 'a12345a').group('lol'))
print(re.search(re.compile(r'(?P<dota>\d+)(?P<lol>\D+)'), 'a12345a').groups())
print(re.search(re.compile(r'(?P<dota>\d+)(?P<lol>\D+)'), 'a12345a').group('dota'))

print(re.search(re.compile(r'(\d\d\d-\d\d\d-\d\d\d)'), 'phone 123-456-890-111').groups())
